/*
In this program, the pulse will happen about once a second. The math is as follows:

The timer is incremented at (CLOCK/4)/RTCC_DIV.

In this example, the timer is incremented (4000000/4)/64 or 15625 times a second (64us).
The interrupt happens every 256 increments. In this example, the interrupt happens 15625/256 or 61 times a second.

The interrupt function decrements a counter (HIGH_START times) until it is zero, then issues the pulse and resets the counter.
In this example, HIGH_START is 61 so the pulse happens once a second. If HIGH_START were 61/2=30, the pulse would be about twice a second.
*/





/*
----------------------------------------------------

InitTMR0 = 256 - ( DELAY * Frequency ) / ( 4* Prescaler)

Ex_1: if 10ms is needed we do this: 256-(0.010*4000000)/(4*256)=217
so  217 should be the RTCC_PRELOAD value.

Ex_2: if 20ms is needed we do this: 256-(0.020*4000000)/(4*256)=177
so 177 should be the RTCC_PRELOAD value.

----------------------------------------------------

10ms -> (10/256)*1000=39, so to get RTCC_PRELOAD value: 256-39=217.
20ms -> (20/256)*1000=78, so to get RTCC_PRELOAD value: 256-78=178.

----------------------------------------------------

*/